/*
 * BSM6.0
 *
 * Copyright 2012-2013 (C) SINODATA CO., LTD. All Rights Reserved.
 */
package com.sinodata.bsm.inmp.conf;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author wangyazhou
 * @version 1.0

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2012-11-17 下午2:30:27          wangyazhou        1.0         To create
 * </p>
 *
 * @since 
 * @see     
 */
public class NetDevice {

    private String jobId = "";

    private String nodeId = "";

    private String snmpSysName = "";

    private String snmpSysOid = ""; //OID

    private String vendorId = ""; //厂商

    private String deviceType = ""; //类别id 

    private String sysService = "";

    private String snmpContact = "";

    private String snmpAdress = "";

    private String snmpDesc = "";

    private List<MEM> memList;

    private List<CPU> cpuList;

    private List<PORT> portList;

    public String[] toRes() {
        String[] arry = new String[8];
        arry[0] = jobId + "," + nodeId;
        arry[1] = snmpSysName;
        arry[2] = snmpDesc;

        arry[3] = snmpSysOid;
        arry[4] = vendorId;
        arry[5] = snmpContact;
        arry[6] = snmpAdress;
        arry[7] = snmpDesc;
        return arry;

    }

    /**
     * 把整个对象转为资源列表
     * @return
     */
    public List<String[]> toAllList() {
        NetType nt = ConfManager.getInstance().getNetNameMap().get(getDeviceType());

        List<String[]> alist = new ArrayList<String[]>();
        String[] arry = new String[9];
        arry[0] = jobId + "," + nodeId;
        arry[1] = snmpSysName;
        arry[2] = snmpDesc;
        arry[3] = nt.getType();

        arry[4] = snmpSysOid;
        arry[5] = vendorId;
        arry[6] = snmpContact;
        arry[7] = snmpAdress;
        arry[8] = snmpDesc;

        alist.add(arry);

        List<CPU> clist = getCpuList();
        for (CPU c : clist) {
            alist.add(c.toRes(nt.getCpuType()));
        }

        List<MEM> mlist = getMemList();
        for (MEM m : mlist) {
            alist.add(m.toRes(nt.getMemType()));
        }

        List<PORT> plist = getPortList();
        for (PORT p : plist) {
            alist.add(p.toRes(nt.getPortType()));
        }

        return alist;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getSnmpSysName() {
        return snmpSysName;
    }

    public void setSnmpSysName(String snmpSysName) {
        this.snmpSysName = snmpSysName;
    }

    public String getSnmpSysOid() {
        return snmpSysOid;
    }

    public void setSnmpSysOid(String snmpSysOid) {
        this.snmpSysOid = snmpSysOid;
    }

    public String getVendorId() {
        return vendorId;
    }

    public void setVendorId(String vendorId) {
        this.vendorId = vendorId;
    }

    public String getSysService() {
        return sysService;
    }

    public void setSysService(String sysService) {
        this.sysService = sysService;
    }

    public String getSnmpContact() {
        return snmpContact;
    }

    public void setSnmpContact(String snmpContact) {
        this.snmpContact = snmpContact;
    }

    public String getSnmpAdress() {
        return snmpAdress;
    }

    public void setSnmpAdress(String snmpAdress) {
        this.snmpAdress = snmpAdress;
    }

    public List<MEM> getMemList() {
        return memList;
    }

    public void setMemList(List<MEM> memList) {
        this.memList = memList;
    }

    public List<CPU> getCpuList() {
        return cpuList;
    }

    public void setCpuList(List<CPU> cpuList) {
        this.cpuList = cpuList;
    }

    public List<PORT> getPortList() {
        return portList;
    }

    public void setPortList(List<PORT> portList) {
        this.portList = portList;
    }

    public String getSnmpDesc() {
        return snmpDesc;
    }

    public void setSnmpDesc(String snmpDesc) {
        this.snmpDesc = snmpDesc;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

}
